<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<jsp:include page="menue.jsp" />

<html>
<head>
<title>index</title>
</head>
<script type="text/javascript">
function submitApp(){
	if(!$.trim($("#appForm-appId").val())){
		alert('[appId]不能空');
		 $("#appForm-appId").focus();
		return;
	};
	
	if(!$.trim($("#appForm-displayName").val())){
		alert('[名称]不能空');
		 $("#appForm-displayName").focus();
		return;
	}; 
	$("#appForm").submit();
}	
</script>
<body>
	<div id="header">
		<h1 style="color: blue; align: center">应用管理</h1>
	</div>

	<h4>APP列表</h4>
	<table class="table">
		<tr>
			<td>No</td>
			<td>appId</td>
			<td>displayName</td>
			<td>description</td>
		</tr>
		<c:forEach items="${items}" var="item" varStatus="status">
			<tr>
				<td>${status.count}</td>
				<td>${item.appId}</td>
				<td>${item.displayName}</td>
				<td>${item.description}</td>
			</tr>
		</c:forEach>
	</table>


	<!-- 添加appId style="display: none"-->
	<h4>添加APP</h4>
	<c:if test="${errorMsg != null}">
		<div style="background-color: #FF0000">${errorMsg}</div>
	</c:if>
	<form id="appForm" name="appForm" action="activityDefinition/saveApp"
		method="post">
		<table>
			<tr>
				<td>appId</td>
				<td><input id="appForm-appId" name="appId" placeholder="appId"
					size="6" maxlength="6" value="${appId}"></td>
			</tr>
			<tr>
				<td>名称</td>
				<td><input id="appForm-displayName" name="displayName"
					placeholder="名称" size="20" maxlength="60" value="${displayName}"></td>
			</tr>
			<tr>
				<td>描述</td>
				<td><input id="appForm-description" name="description"
					placeholder="描述" size="20" maxlength="60" value="${description}"></td>
			</tr>
			<tr>
				<td><input type="checkbox" name="update" value="1"
					<c:if test="${update ==1}">checked</c:if>>修改</td>
				<td><input type="button" value="提交"
					onclick="javascript:submitApp();" /></td>
			</tr>
		</table>
	</form>
</body>
</html>